﻿@model StoreManager.Models.ImportOrderSearchView
@using PagedList.Mvc
@{
    ViewBag.Title = "Index";
    var order = new StoreManager.Models.ImportOrder();
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Product</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.ImportOrderNo)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model =>  model.ImportOrderNo)
            @Html.ValidationMessageFor(model =>  model.ImportOrderNo)
        </div>
             <div class="editor-label">
            @Html.LabelFor(model => model.Status)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model =>  model.Status)
            @Html.ValidationMessageFor(model =>  model.Status)
        </div>
     
       <p>
            <input type="submit" name="Index" value="Search" />
        </p>
    </fieldset>
}
<table>
    <tr>
        <th>
            @Html.DisplayNameFor(o => order.ImportOrderNo)
        </th>
        <th>
            @Html.DisplayNameFor(o => order.StaffID)
        </th>
        <th>
            @Html.DisplayNameFor(o => order.Type)
        </th>
        <th>
            @Html.DisplayNameFor(o => order.ImportDate)
        </th>
        <th>
            @Html.DisplayNameFor(o => order.SupplierID)
        </th>
        <th>
            @Html.DisplayNameFor(o => order.ModifiedBy)
        </th>
        <th>
            @Html.DisplayNameFor(o => order.Created)
        </th>
        <th>
            @Html.DisplayNameFor(o => order.LastModified)
        </th>
        <th></th>
    </tr>

@if(Model.SearchResults != null && Model.SearchResults.Count > 0) {
foreach (var item in Model.SearchResults)
{
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.ImportOrderNo)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.StaffID)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Type)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ImportDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.SupplierID)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Created)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CreatedBy)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ImportOrderID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ImportOrderID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ImportOrderID })
        </td>
    </tr>
 }
}
</table>
